<template>
	<div>
		<el-tabs v-model="tab" @tab-click="cutTabs">
			<el-tab-pane label="轮播图" name="carousel">
				<carousel v-if="tab === 'carousel'"></carousel>
			</el-tab-pane>
			<el-tab-pane label="分享设置" name="share">
				<!-- <share v-if="tab === 'share'"></share> -->
			</el-tab-pane>
			<!-- <el-tab-pane label="关于我们" name="about"><about v-if="tab == 'about'"></about></el-tab-pane> -->
		</el-tabs>
	</div>
</template>

<script setup>
	import { ref, onMounted, getCurrentInstance } from 'vue'
	import carousel from './carousel'
	import share from './share_set'
	// import about from './about';
	const { proxy } = getCurrentInstance()
	
	const tab = ref('carousel')
	
	onMounted(() => {
		tab.value = uni.getStorageSync('__cutSta' + proxy.$route.path) || 'carousel'
	})
	
	const cutTabs = (res) => {
		uni.setStorage({
			key: '__cutSta' + proxy.$route.path,
			data: res.name
		})
	}
</script>

<style></style>
